// // store/index.ts
// import { createStore } from 'vuex'
 
// const store = createStore({
//   state() {
//     return {
//       count: 0
//     }
//   },
//   mutations: {
//     increment(state: any) {
//       state.count++
//     }
//   }
// })
 
// export default store

import { defineStore, acceptHMRUpdate } from "pinia";
 
export const useStore = defineStore({
  id: "index",
  state: () => ({
    name: "old name",
  }),
  getters: {
    myName: (state) => {
        return `getters ${state.name}`
    }
  },
  actions: {
    changeName(name: string) {
        this.name = name
    }
  },
});
 
if (import.meta.hot) {
    import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot))
}